/********************************************************************
*   BCD code to LED displayer
*						________
*						|		a		|
*				  f |				| b
*						|_______|
*						|		g		|
*					e |				| c
*						|_______|				· h
*								d
********************************************************************/

module digDecoder (
  input   wire [3:0]  idata,

  output  reg  [7:0]  dig  
);

localparam  _0_ = 8'b1100_0000,
            _1_ = 8'b1111_1001,
            _2_ = 8'b1010_0100,
            _3_ = 8'b1011_0000,
            _4_ = 8'b1001_1001,
            _5_ = 8'b1001_0010,
            _6_ = 8'b1000_0010,
            _7_ = 8'b1111_1000,
            _8_ = 8'b1000_0000,
            _9_ = 8'b1001_0000;

always @(*) begin
  case(idata)
    4'd0: dig = _0_;
    4'd1: dig = _1_;
    4'd2: dig = _2_;
    4'd3: dig = _3_;
    4'd4: dig = _4_;
    4'd5: dig = _5_;
    4'd6: dig = _6_;
    4'd7: dig = _7_;
    4'd8: dig = _8_;
    4'd9: dig = _9_;
    default: dig = _8_;
  endcase
end
    
endmodule
